package com.lagou.module01.bean;

/**
 * @Author: xyk
 * @Date: Create in 23:05 2021/3/14
 * @Description:
 */
public class PageBean {
    private int page; // 声明成员变量表示页码数
    private int rows; // 声明成员变量表示每页行数
    private int start; // 声明成员变量表示起始位置

    public PageBean(int page, int rows) {
        this.page = page;
        this.rows = rows;
        setStart();
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getRows() {
        return rows;
    }

    public void setRows(int rows) {
        this.rows = rows;
    }

    public int getStart() {
        return start;
    }

    public void setStart() {
        this.start = (page-1) * rows;
    }

    @Override
    public String toString() {
        return "PageBean{" +
                "page=" + page +
                ", rows=" + rows +
                ", start=" + start +
                '}';
    }
}
